package cn.school.service;

import cn.school.dao.AdminMapper;
import cn.school.dao.GradeMapper;
import cn.school.entity.Admin;
import cn.school.entity.Grade;
import cn.school.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * servlet ->Service=>Mapper
 */
public class AdminService {

    public static final AdminService INST=new AdminService();

    public Admin login(String name, String pass){
        SqlSession s= MybatisUtil.get();
        try {
            return s.getMapper(AdminMapper.class).login(name,pass);
        }finally {
            MybatisUtil.close(s);
        }
    }

}
